//NO.1103
class Solution {
public:
    vector<int> distributeCandies(int candies, int num_people) {
        vector<int> people(num_people, 0);
        int i = 0;
        while (candies)
        {
            people[i % num_people] += min(candies, i + 1);
            candies -= min(candies, i + 1);
            i++;
        }
        return people;
    }
};